package homework.five;

import java.util.Scanner;

public class PrimeNumberThreadApp {
    public static void main(String[] args) {
        PrimeNumberThreadApp primeNumberThreadApp = new PrimeNumberThreadApp();
        primeNumberThreadApp.execute();
    }

    public void execute(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入：");
        Long number = scanner.nextLong();
        Long number1 = scanner.nextLong();
        System.out.println("输入了：" + number + "," + number1);
        int testerCount = 0;
        while ((number != 0) && (number1 != 0)){
            PrimeNumberTester primeNumberTester = new PrimeNumberTester(number, number1);
            testerCount++;
            primeNumberTester.setName("primeNumberTester" + testerCount);// 为线程赋予名字
            primeNumberTester.start();
            System.out.println("请输入：");
            number = scanner.nextLong();
            number1 = scanner.nextLong();
            System.out.println("输入了：" + number + "," + number1);
        }
    }
}
